import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { BankTransferComponent } from '../business/bank-transfer/bank-transfer.component';
import { BankMessageConfirmComponent } from '../business/bank-transfer/component/bank-message-confirm/bank-message-confirm.component';
import { TransferListComponent } from '../business/bank-transfer/component/transfer-list/transfer-list.component';
import { AccountComponent } from './account/account.component';
import { MeComponent } from './me.component';
import { MsgComponent } from './msg/msg.component';
import { OrderProgressComponent } from './order-query/order-progress/order-progress.component';
import { OrderQueryComponent } from './order-query/order-query.component';
import { UserBindAddComponent } from './user-bind/user-bind-add/user-bind-add.component';
import { UserBindListComponent } from './user-bind/user-bind-list/user-bind-list.component';
import { UserBindComponent } from './user-bind/user-bind.component';
import { NoteOrderComponent } from './msg/note-order.component';
import { MessageComponent } from './message/message.component';
import { MessageDetailComponent } from './message/message-detail/message-detail.component';

const routes: Routes = [
  { path: 'me', component: MeComponent, data: { breadcrumb: '个人中心' },
    children: [
      { path: 'account', component: AccountComponent, data: { breadcrumb: '用户信息' } },
      { path: 'user-bind', component: UserBindComponent, data: { breadcrumb: '用户绑定' }, 
        children: [
          { path: 'add', component: UserBindAddComponent, data: { breadcrumb: '添加绑定' } },
          { path: 'list', component: UserBindListComponent, data: { breadcrumb: '绑定列表' } },
          { path: '**', redirectTo: '/me/user-bind/list' }
        ]
      },
      { path: 'order-query', component: OrderQueryComponent, data: { breadcrumb: '工单查询' }, 
        children: [
          
        ]
      },
      { path: 'order-progress', component: OrderProgressComponent, data: { breadcrumb: '工单跟踪' } },
      { path: 'msg', component: MsgComponent, data: { breadcrumb: '信息定制' }, 
      },
      { path: 'msg/add', component: NoteOrderComponent, data: { breadcrumb: '修改信息定制' }, 
      },
      { path: 'message', component: MessageComponent, data: { breadcrumb: '我的消息' }},
      { path: 'message/detail', component: MessageDetailComponent, data: { breadcrumb: '我的消息详情' }},
      { path: 'bank-trans', component: BankTransferComponent, data: { breadcrumb: '银行划扣' },
        children: [
          { path: 'list', component: TransferListComponent, data: { breadcrumb: '列表信息' } }, 
          { path: 'confirm', component: BankMessageConfirmComponent, data: { breadcrumb: '新增' } }, 
          { path: '**', redirectTo: 'list' }
        ]
      },
      
      { path: '**', redirectTo: '/me/account' }
    ] 
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class MeRoutingModule { }
